import request from '@/request/index.js';

// 获取租户id
export const getTenantId = (website) => {
  return request.get({
    url: '/app-api/system/tenant/get-by-website',
    data: { website },
    custom: {
      title: '获取租户id',
      authentication: false
    }
  })
}

export function getHospitalInfo() {
	return request.get({
		url: '/app-api/hospital/hosptial-info/get-hospital-info',
		params: {},
		custom: {
			title: "获取医院信息",
			authentication: true
		}
	});
}

export function getHospitalList() {
	return request.get({
		url: '/app-api/hospital/hosptial-info/get-hospital-List',
		params: {},
		custom: {
			title: "获取医院列表",
			authentication: false
		}
	});
}

export function getHospitalAddressDict() {
	return request.get({
		url: '/app-api/hospital/hosptial-info/get-hospital-address-code',
		params: {},
		custom: {
			title: "获取医院地区编码信息",
			authentication: true
		}
	});
}

export function getHospitalConfig() {
	return request.get({
		url: '/app-api/hospital/config/get-hospital-config',
		params: {},
		custom: {
			title: "获取医院配置信息",
			authentication: true
		}
	});
}

export function getHospitalConfigRichText(params) {
	return request.get({
		url: '/app-api/hospital/hosptial-info/get-hospital-config',
		params: params || {},
		custom: {
			title: "获取医院某个配置-富文本",
			authentication: true
		}
	});
}

export function getInHospital(params) {
	return request.get({
		url: '/app-api/hospital/hospitalized/list',
		params: params || {},
		custom: {
			title: "获取住院记录",
			authentication: true
		}
	});
}
// 查询住院费用汇总
export function getInHospitalTotal(params) {
	return request.get({
		url: '/app-api/hospital/hospitalized/cost-summary',
		params: params || {},
		custom: {
			title: "查询住院费用汇总",
			authentication: true
		}
	});
}
// 查询住院费用清单
export function getCostLists(params) {
	return request.get({
		url: '/app-api/hospital/hospitalized/cost-list',
		params: params || {},
		custom: {
			title: "查询住院费用清单",
			authentication: true
		}
	});
}
// 查询住院一日清单
export function getCostDaylyList(params) {
	return request.get({
		url: '/app-api/hospital/hospitalized/cost-daily',
		params: params || {},
		custom: {
			title: "查询住院一日清单",
			authentication: true
		}
	});
}
// 查询出院带药列表
export function getDrugList(params) {
	return request.get({
		url: '/app-api/hospital/hospitalized/drug-list',
		params: params || {},
		custom: {
			title: "查询出院带药列表",
			authentication: true
		}
	});
}
// 获取住院证
export function getCertificate(params) {
	return request.get({
		url: '/app-api/hospital/hospitalized-log/detail',
		params: params || {},
		custom: {
			title: "获取住院证",
			authentication: true
		}
	});
}

export function getSubscriptionTemplateIds(params) {
	return request.get({
		url: '/app-api/hospital/subscription/query-by-app-id',
		params: {
			appId: wx.getAccountInfoSync().miniProgram.appId
		},
		custom: {
			title: "获取订阅消息模版",
			authentication: false
		}
	});
}